﻿<Window x:Class="IGolovkine.ShoutCastRipper.UI.AdminPanel.AdminPanelWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:IGolovkine.ShoutCastRipper.UI.AdminPanel"
    Title="Station Ripper Service" Height="385" Width="747">
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Close" Executed="ApplicationCommandExecuted"/>
    </Window.CommandBindings>
        <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="181*"/>
            <RowDefinition Height="125*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <GridSplitter Grid.Column="0" Grid.Row="2" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
        <Menu Grid.Row="0">
            <MenuItem Header="File">
                <MenuItem Command="ApplicationCommands.Close"/>
            </MenuItem>
        </Menu>
        
        <ListView Name="_statusListView" Grid.Row="1" SelectionMode="Extended" Height="Auto" Width="Auto">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="Auto" Header="Name" DisplayMemberBinding="{Binding Path=Name}"/>
                    <GridViewColumn Width="Auto" Header="Status" DisplayMemberBinding="{Binding Path=Status}"/>
                    <GridViewColumn Width="Auto" Header="Url" DisplayMemberBinding="{Binding Path=Url}"/>
                    <GridViewColumn Width="Auto" Header="Title" DisplayMemberBinding="{Binding Path=ContentTitle}"/>
                    <GridViewColumn Width="Auto" Header="Length" DisplayMemberBinding="{Binding Path=ContentLength}"/>
                </GridView>
            </ListView.View>
            <ListView.ContextMenu>
                <ContextMenu>
                    <MenuItem Command="local:AdminPanelCommands.StartStationRipper"/>
                    <MenuItem Command="local:AdminPanelCommands.StopStationRipper"/>
                    <MenuItem Command="local:AdminPanelCommands.SkipCurrentTitle"/>
                    <MenuItem Command="local:AdminPanelCommands.StopAfterCurrentTitle"/>
                    <Separator/>
                    <MenuItem Header="Configure..."/>
                </ContextMenu>
            </ListView.ContextMenu>
            <ListView.CommandBindings>
                <CommandBinding Command="local:AdminPanelCommands.StartStationRipper" Executed="StatusListViewCommandExecuted"/>
                <CommandBinding Command="local:AdminPanelCommands.StopStationRipper" Executed="StatusListViewCommandExecuted"/>
                <CommandBinding Command="local:AdminPanelCommands.SkipCurrentTitle" Executed="StatusListViewCommandExecuted"/>
                <CommandBinding Command="local:AdminPanelCommands.StopAfterCurrentTitle" Executed="StatusListViewCommandExecuted"/>
            </ListView.CommandBindings>
        </ListView>
        <ListView Grid.Row="2" Name="_eventListView">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="Auto" Header="Source" DisplayMemberBinding="{Binding Path=SourceName}"/>
                    <GridViewColumn Width="Auto" Header="Time" DisplayMemberBinding="{Binding Path=Time, StringFormat=\{0:HH:mm:ss\}}"/>
                    <GridViewColumn Width="600" Header="Description">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock TextWrapping="Wrap" Text="{Binding Path=Description}"/>
                             </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
            <ListView.ContextMenu>
                <ContextMenu>
                    <MenuItem Command="ApplicationCommands.Copy"/>
                </ContextMenu>
            </ListView.ContextMenu>
            <ListView.CommandBindings>
                <CommandBinding Command="ApplicationCommands.Copy"/>
            </ListView.CommandBindings>
        </ListView>
        <StatusBar Name="_statusBar" Grid.Row="3"  BorderBrush="DarkGray" BorderThickness="1">
            <TextBlock Text="{Binding Path=Status}"></TextBlock>
        </StatusBar>
    </Grid>
</Window>
